
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>联通大数据交易集市</title>
    <meta name="keywords" content="抓手数据|大数据交易|大数据|数据包|生态圈|数据包集市|API集市|报告集市"/>
    <meta name="description" content="抓手数据平台是一个全网系大数据交易平台，是独立同时支持个人和机构用户的综合实时在线交易系统，旨在促进数据流通、公正、有公信力、创新型的第三方数据交易平台，平台提供数据出售、数据购买、数据提供商查询以及数据需求发布等模块综合配套服务。"/>
    <link href="<?=base_url()?>css/reg3.css" rel="stylesheet"/>
    <script type="text/javascript" src="<?=base_url()?>js/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="<?=base_url()?>css/tpshop.css"/>
    <script src="<?=base_url()?>js/layer.js"></script><!--弹窗js 参考文档 http://layer.layui.com/-->
    <script src="<?=base_url()?>js/global.js"></script>
    <link rel="icon" href="<?=base_url()?>images/favicon.ico"/>
</head>
<body style="background: #fff;">
<div style="background: #f5f5f5;height: 25px">
    <p class="w1224">
        <a href="<?=base_url()?>index.php/home/index/index" style="line-height: 25px">返回首页</a>
    </p></div>
<div class="regcon">
    <div class="ui_tab">
        <ul class="ui_tab_nav regnav">
            <li class="uli active "><a href="register">手机注册</a></li>
            <!-- <li class="uli  "><a href="/Home-User-reg-t-email.html">邮箱注册</a></li> -->
            <li class="no fn-fr loginbtn">我已注册，马上<a href="index">登录></a></li>
        </ul>
                    <form id="reg_form2" onsubmit="return false">
                <input type="hidden" name="scene" value="1">
                <div class="ui_tab_content">
                    <div class="m-fnbox ui_panel" style="display: block;">
                        <div class="fnlogin clearfix">

                            <div class="line">
                                <label class="linel"><span class="dt">手机号码：</span></label>
                                <div class="liner">
                                    <input type="text" class="inp fmobile J_cellphone" placeholder="请输入手机号码"
                                           name="username" id="username" required="" maxlength="11"/>
                                    <p class="fn-fl errorbox v-txt" id="err_username">*手机号码输入不正确</p>
                                </div>
                            </div>
                            <div class="line">
                                <label class="linel"><span class="dt">设置密码：</span></label>
                                <div class="liner">
                                    <input type="password" class="inp fpass J_password"
                                           placeholder="6-16位大小写英文字母、数字或符号的组合" autocomplete="off" maxlength="16"
                                           id="password" name="password" value="" required=""/>
                                    <p class="fn-fl noticebox v-txt2" id="err_password">*6-16位字符，建议由字母、数字和符号两种以上组合</p>
                                </div>
                            </div>
                            <div class="line">
                                <label class="linel"><span class="dt">确认密码：</span></label>
                                <div class="liner">
                                    <input type="password" class="inp fsecpass J_password2" placeholder="请再次输入密码"
                                           autocomplete="off" maxlength="16" id="password2" name="password2" required=""
                                           value=""/>
                                    <p class="fn-fl errorbox v-txt" id="err_password2">*两次输入密码不一致</p>
                                </div>
                            </div>
                            <div class="line">
                                <label class="linel"><span class="dt">图像验证码：</span></label>
                                <div class="liner">
                                    <input type="text" class="inp imgcode J_imgcode" placeholder="图像验证码"
                                           id="verify_code2" name="verify_code" required=""/>
                                    <img width="100" height="35" src="<?=base_url()?>index.php/home/captcha/index"
                                         id="reflsh_code2"  onclick="verify('reflsh_code2')" class="po-ab to0">
                                    <p class="fn-fl errorbox v-txt" id="err_verify_code">*请输入验证码</p>
                                </div>
                                <div id="show-voice" class="show-voice"></div>
                            </div>
                                                        <div class="line liney clearfix">
                                <div class="liner">
                                    <div class="clearfix checkcon">
                                        <p class="fn-fl checktxt"><input type="checkbox" class="iyes fn-fl J_protocal"
                                                                         checked/>
                                            <span class="fn-fl">我已阅读并同意</span><a class="itxt fn-fl"
                                                                                 href="/Home-Article-detail-article_id-1415.html"
                                                                                 target="_blank">《联通大数据服务协议》</a>
                                        </p>
                                        <p class="fn-fl errorbox v-txt" id="protocalBox"></p>
                                    </div>
                                    <a id="submit" class="regbtn J_btn_agree" href="javascript:void(0);"
                                       onClick="$('#reg_form2').submit();">同意协议并注册</a>
                                    <p class="v-txt" id="err_check_code"><span class="fnred">请勾选</span>我已阅读并同意<a
                                            class="itxt" href="/Home-Article-detail-article_id-1415.html"
                                            target="_blank">《联通大数据服务协议》</a></p>
                                </div>
                            </div>
                        </div>
                        <div class="reg-img"></div>
                    </div>
                </div>
            </form>
        
    </div>
</div>
<div class="goContact">
    <img src="<?=base_url()?>images/contact.png" alt="客服">
</div>
<div class="contact_type">
    <div class="right-contact-us">
        <span class="phone">010-65916788</span>
    </div>
</div>
<div class="goTop">
    <img src="<?=base_url()?>images/goTop.png" alt="返回顶部">
</div>
<script>
    var min_height = $(window).height();
    $(window).scroll(function () {
        var s = $(window).scrollTop();
        if (s > min_height) {
            $(".goTop").show();
        } else {
            $(".goTop").hide();
        }
        ;
    });
    $(".goTop").mouseenter(function () {
        $(this).find("img").attr("src", "<?=base_url()?>images/goTop_w.png");
        $(".goTop").click(function () {
            $("html,body").animate({scrollTop: 0}, 500);
        });
        $(".goTop").mouseleave(function () {
            $(this).find("img").attr("src", "<?=base_url()?>images/goTop.png");
        });
    });
    $(".goContact").mouseenter(function () {
        $(".contact_type").animate({width: "135px"}, 100);
        $(this).find("img").attr("src", "<?=base_url()?>images/contact_w.png");
        $(".goContact").mouseleave(function () {
            $(".contact_type").animate({width: "0px"}, 100);
            $(this).find("img").attr("src", "<?=base_url()?>images/contact.png");
        });
    });
</script>
<!-- footer置底 -->
<script>
    var footerT = min_height - 346;
    var bodyH = $("body").height();
    if (bodyH <= min_height) {
        $(".footer").css({
            position: 'absolute',
            top: footerT + 'px',
            bottom: 0,
            left: 0,
            right: 0
        });
    }
</script>

<script>

    $(document).ready(function () {
        $('input').click(function () {
            $(this).siblings('p').hide();
        });
    });
    $(function () {
        $(document).on("click", '#submit', function (e) {
            var isSubmit = check_submit();
            if (isSubmit) {
                $.ajax({
                    type: "POST",
                    url: "verifyRegister",
                    dataType: "json",
                    data: $('#reg_form2').serialize(),
                    success: function (data) {
                        /*if (data.status == 1) {
                            layer.msg(data.msg, {icon: 1}, function () {
                                window.location.href = "/Home-Index-index.html";
                            });
                        } else {
                            layer.alert(data.msg, {icon: 2}, function (index) {
                                $('.verifyImg').trigger('click');
                                layer.close(index);
                            });
                        }*/
                        if(data.code){
                            layer.alert(data.desc, {icon: 2, time: 2000});
                        } else {
                            layer.alert(data.desc, {icon: 2, time: 2000});
                            window.location.href = "<?=base_url()?>index.php/home/index/index";
                        }
                    }
                });
            }
        })
    })

    // 普通 图形验证码
    function verify(id) {
        $('#' + id).attr('src', '<?=base_url()?>index.php/home/captcha/index?r=' + Math.random());
    }

    function check_submit() {
        var username = $('input[name="username"]').val();
        var password = $('#password').val();
        var password2 = $('input[name="password2"]').val();
        var verify_code = $('input[name="verify_code"]').val();
        var agree = $('input[type="checkbox"]:checked').val();
        var error = '';

        $("p[id^='err_']").each(function () {
            $(this).hide();
        });

        (username == '') && $('#err_username').show();
        ($.trim($('#code').val()) == '') && $('#err_code').show();
        (password == '' || password.length < 6) && $('#err_password').show();
        (password2 != password) && $('#err_password2').show();
        (verify_code == '') && $('#err_verify_code').show();
        (agree != 'on') && $('#err_check_code').show();
        if ($('#username').hasClass('fmobile')) {
            if (!checkMobile(username)) {
                $('#err_username').show();
            }
        } else {
            if (!checkEmail(username)) {
                $('#err_username').show();
            }
        }
        if ($("p[id^='err_']:visible").length > 0) {
            return false;
        } else {
            return true;
        }
    }

    // 电子邮件注册  和 手机号码注册 切换
    function reg_tab(id, id2) {
        $('#' + id).addClass('ema-tab');
        $('#' + id2).removeClass('ema-tab');
        $('#' + id + '_div').show();
        $('#' + id2 + '_div').hide();
    }

    // 发送手机短信
    function send_sms_reg_code() {
        var mobile = $('input[name="username"]').val();
        var verify_code = $('input[name="verify_code"]').val();
        if (!checkMobile(mobile)) {
            layer.alert('请输入正确的手机号码', {icon: 2});//alert('请输入正确的手机号码');
            return;
        }
        if (verify_code == '') {
            layer.alert('请输入图像验证码', {icon: 2});//alert('请输入正确的手机号码');
            return;
        }
        var url = "/index.php?m=Home&c=Api&a=send_validate_code&scene=1&type=mobile&mobile=" + mobile + "&verify_code=" + verify_code;
        $.ajax({
            type: "GET",
            url: url,
            dataType: "json",
            success: function (data) {
                if (data.status == 1) {
                    $('#count_down').attr("disabled", "disabled");
                    intAs = 60; // 手机短信超时时间
                    jsInnerTimeout('count_down', intAs);
                    layer.alert(data.msg, {icon: 1});
                } else {
                    layer.alert(data.msg, {icon: 2});
                }
            }
        });
    }

    // 发送邮箱
    function send_smtp_reg_code() {
        var email = $('input[name="username"]').val();
        var verify_code = $('input[name="verify_code"]').val();
        if (!checkEmail(email)) {
            layer.alert('请输入正确的邮箱', {icon: 2});//alert('请输入正确的手机号码');
            return;
        }
        if (verify_code == '') {
            layer.alert('请输入图像验证码', {icon: 2});//alert('请输入正确的手机号码');
            return;
        }
        $.ajax({
            type: "POST",
            url: "/Home-Api-send_validate_code.html",
            data: {type: 'email', send: email, scene: 1, verify_code: verify_code},// 你的formid
            dataType: "json",
            success: function (data) {
                if (data.status == 1) {
                    $('#count_down').attr("disabled", "disabled");
                    intAs = 60; // 发送邮箱超时时间
                    jsInnerTimeout('count_down', intAs);
                    layer.alert(data.msg, {icon: 1});
                } else {
                    layer.alert(data.msg, {icon: 2});
                }
            }
        });
    }

    $('#count_down').removeAttr("disabled");

    //倒计时函数
    function jsInnerTimeout(id, intAs) {
        var codeObj = $("#" + id);
        intAs--;
        if (intAs <= -1) {
            codeObj.removeAttr("disabled");
            codeObj.text("发送");
            return true;
        }

        codeObj.text(intAs + '秒');

        setTimeout("jsInnerTimeout('" + id + "'," + intAs + ")", 1000);
    };


    function checkMobile(tel) {
        var reg = /^1[0-9]{10}$/;
        if (reg.test(tel)) {
            return true;
        } else {
            return false;
        }
        ;
    }

    function checkEmail(str) {
        var reg = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        if (reg.test(str)) {
            return true;
        } else {
            return false;
        }
    }
</script>
</body>
</html>
